package com.peng.spring.DI;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;

/**
 * @Author peng
 * @Date 2024-04-16 11:43
 */
public class TestUserDao {

    public static void main(String[] args) {
        AnnotationConfigApplicationContext annotationConfigApplicationContext = new AnnotationConfigApplicationContext("com.peng.spring.DI");
        UserDao userDao1 = annotationConfigApplicationContext.getBean(UserDao.class);
        System.out.println("userDao1 = " + userDao1);
        UserService userService = annotationConfigApplicationContext.getBean(UserService.class);
        System.out.println("userService = " + userService);
    }
}
